{\rtf1\ansi\ansicpg936\cocoartf1138\cocoasubrtf510
{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fnil\fcharset134 STHeitiSC-Light;\f2\fnil\fcharset0 Monaco;
}
{\colortbl;\red255\green255\blue255;\red224\green197\blue137;\red143\green157\blue106;\red117\green135\blue166;
\red207\green106\blue76;\red236\green240\blue249;}
\paperw11900\paperh16840\margl1440\margr1440\vieww10800\viewh8400\viewkind0
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural

\f0\fs24 \cf0 rails 
\f1 \'b6\'e0\'ca\'fd\'be\'dd\'bf\'e2\'c1\'ac\'bd\'d3\
\
\'bb\'b7\'be\'b3: ruby 1.9.3 rails 3.2.8  mysql 5.X\
\'cf\'ee\'c4\'bf\'c3\'fb\'b3\'c6 : test_database_connect\
\'ca\'fd\'be\'dd\'bf\'e2\'cd\'bc(\'bd\'f6\'d2\'d4
\f2\fs22 \cf2 development
\f1\fs24 \cf0 \'c4\'a3\'ca\'bd\'ce\'aa\'c0\'fd):\
  1) \'cf\'ee\'c4\'bf\'d7\'d4\'bd\'a8\'ca\'fd\'be\'dd\'bf\'e2:\
 	test_database_connect_development(\'bf\'e2)\
		|\
		|---users(\'b1\'ed)\
		|__(\'b1\'ed)\
   2) \'c1\'ed\'cd\'e2\'d2\'d1\'d6\'aa\'ca\'fd\'be\'dd\'bf\'e2\
	project_database\
		|\
		|--- users_info\
		|__ resources\
\'cf\'ee\'c4\'bf\'d7\'d4\'bd\'a8\'ca\'fd\'be\'dd\'bf\'e2\'be\'cd\'b2\'bb\'cb\'b5\'c1\'cb,\'bf\'b4\'d2\'bb\'cf\'c2Rails\'d4\'f5\'c3\'b4\'c1\'ac\'bd\'d3\'c1\'ed\'d2\'bb\'b8\'f6\'ca\'fd\'be\'dd\'bf\'e2(project_database).\
\'b5\'da\'d2\'bb\'b2\'bd.\'ca\'d7\'cf\'c8\'b4\'f2\'bf\'aa config/database.yml \'ce\'c4\'bc\'fe\
\'d7\'ee\'ba\'f3\'cc\'ed\'bc\'d3 \'d2\'bb\'cf\'c2\'b4\'fa\'c2\'eb:\
\
\pard\pardeftab720

\f2\fs22 \cf2 project_database:\cf0 \
\cf2   defaults:\cf3  \cf4 &defaults\cf0 \
\cf2     adapter:\cf3  mysql2\cf0 \
\cf2     reconnect:\cf3  false\cf0 \
\cf2     encoding:\cf3  utf8\cf0 \
\cf2     pool:\cf3  \cf5 5\cf0 \
\cf2     user:\cf3  root\cf0 \
\cf2     password:\cf0 \
\cf2     socket:\cf3  /tmp/mysql.sock\cf0 \
\pard\pardeftab720
\cf3     \cf0 \
\pard\pardeftab720
\cf2   development:\cf0 \
\cf2     <<:\cf3  \cf4 *defaults\cf0 \
\cf2     database:\cf3  project_database\cf0 \
\pard\pardeftab720
\cf3     \cf0 \
\pard\pardeftab720
\cf2   test:\cf0 \
\cf2     <<:\cf3  \cf4 *defaults\cf0 \
\cf2     database:\cf3  project_database\cf0 \
\pard\pardeftab720
\cf3   \cf0 \
\pard\pardeftab720
\cf2   production:\cf0 \
\cf2     <<:\cf3  \cf4 *defaults\cf0 \
\cf2     database:\cf3  project_database\
\pard\pardeftab720

\f1\fs24 \cf0 \'b8\'f1\'ca\'bd\'d3\'eb\'d4\'ad\'c9\'fa\'b5\'c4\'c0\'e0\'cb\'c6,\'c3\'bf\'b8\'f6\'d7\'d6\'b6\'ce\'b4\'fa\'b1\'ed\'ca\'b2\'c3\'b4\'d2\'e2\'cb\'bc\'d2\'b2\'be\'cd\'b2\'bb\'d3\'c3\'ce\'d2\'d4\'d9\'86\'aa\'e0\'c2\'c1\'cb.\'ba\'c7\'ba\'c7\'a1\'ad.
\f2\fs22 \cf3 \

\f1\fs24 \cf0 \'b5\'da\'b6\'fe\'b2\'bd,\'d4\'da models\'ce\'c4\'bc\'fe\'cf\'c2\'cc\'ed\'bc\'d3 project_database.rb \'ce\'c4\'bc\'fe,\'c8\'bb\'ba\'f3\'d4\'da\'d5\'e2\'b8\'f6\'ce\'c4\'bc\'fe\'c4\'da\'cc\'ed\'bc\'d3\'b4\'fa\'c2\'eb\
\pard\pardeftab720

\f2\fs22 \cf0 class ProjectDatabase < ActiveRecord::Base\
#
\f1\fs28 \cb6 \'b1\'ed\'ca\'be\'d5\'e2\'b8\'f6\'c4\'a3\'d0\'cd\'c0\'e0\'b2\'bb\'bb\'e1\'d3\'eb\'bf\'e2\'d6\'d0\'b5\'c4\'c8\'ce\'ba\'ce\'b1\'ed\'d3\'d0\'b9\'d8\'cf\'b5\'a3\'ac\'d2\'b2\'be\'cd\'ca\'c7\'d2\'bb\'b8\'f6\'b3\'e9\'cf\'f3\'b5\'c4\'c0\'e0
\f2\fs22 \cb1 \
  self.abstract_class = true\
#
\f1\fs28 \cb6 \'be\'cd\'ca\'c7\'c5\'e4\'d6\'c3\'c1\'ac\'bd\'d3
\f2\fs22 \cb1 \
  establish_connection configurations["
\f1\fs24 project_database
\f2\fs22 "][::Rails.env]\
end\
\pard\pardeftab720

\f1 \cf0 \'b5\'bd\'d5\'e2\'c0\'ef,\'ca\'fd\'be\'dd\'bf\'e2\'c1\'ac\'bd\'d3\'c5\'e4\'d6\'c3\'cd\'ea\'b3\'c9,\'ce\'d2\'b5\'bd\'d5\'e2\'c0\'ef\'ca\'c7\'c3\'bb\'d3\'d0\'ce\'ca\'cc\'e2\'b5\'c4.\
\'b5\'da\'c8\'fd\'b2\'bd,\'d7\'ee\'ba\'f3 \'ce\'aa\'c3\'bf\'d2\'bb\'b8\'f6\'b1\'ed\'bd\'a8\'c1\'a2\'be\'df\'cc\'e5\'c4\'a3\'d0\'cd\'c0\'e0,\'d5\'e2\'c0\'ef\'d6\'bb\'d3\'c3resource\'ce\'aa\'c0\'fd
\f2 \cf3 \
\pard\pardeftab720
\cf0  
\f1 \'bd\'a8\'c1\'a2\'b2\'bd\'d6\'e8\'d3\'eb\'c9\'cf\'c3\'e6\'d2\'bb\'b2\'bd\'ca\'c7\'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